package cn.hackertools.staticresource.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HomeController {

    @Value(value = "${static-resouce-islogin}")
    private String isLogin;

    @RequestMapping(value = {"/","/index"})
    public ModelAndView toHome(){
        String url="";
        if("true".equals(isLogin))
        {
            url="login";
        }else{
            url="project/main";
        }
        ModelAndView mode=new ModelAndView(url);

        return mode;
    }
}
